package net.oschina.dajiangnan.wx.constants;

import javax.servlet.ServletConfig;

import net.oschina.dajiangnan.wx.Wx;

public class Custom {

	public static Wx wx;

	public static Wx getWx() {
		return wx;
	}

	public static void setWx(Wx wx) {
		Custom.wx = wx;
	}
	
	
	
	
	public static void init(ServletConfig config){
		if(wx == null){
            try {
                wx = (Wx) Class.forName(config.getInitParameter("WxImplClassName")).newInstance();
            } catch (InstantiationException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }
        }
	}
}
